import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:guo_xue_app/pages.dart';







final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized(); //必须要添加这个进行初始化 否则下面会错误
  // ChuShiHua();
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
      .then((_) {
    // gobalUtils.postAuthLogin();
    runApp(MyApp());
  });
}
/**
 * 初始化操作
 */

void ChuShiHua() async {
  try {
    // gobalUtils.chuShiZhiXing();
  } catch (a) {}
}

class MyApp extends StatelessWidget {
  @override
  build(BuildContext context) {
    //填入设计稿中设备的屏幕尺寸,单位dp
    return ScreenUtilInit(
        designSize: Size(375, 812),
        builder: (context, _) {
          return GetMaterialApp(
            debugShowCheckedModeBanner: false,
            // initialRoute: "/",
            getPages: AppRoutes.pages,
            builder: (context, widget) {
              return MediaQuery(
                ///设置文字大小不随系统设置改变
                data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
                child: widget!,
              );
            },
            home:FrontNavigationBarPage(),
          );
        });
  }
}




